// Object.is()：判断两个对象是否相等
// Object.assign(obj1,...obj2)：传入多个对象，把从第二个对象开始的属性合并到第一个对象中
// Object.fromEntries()：把键值对数组变为对象（可以直接把Map对象转为对象）


// Object.is() 就是 === 的蛋疼写法
console.log("Object.is(1,1) = ",Object.is(1,1));
console.log("Object.is('1',1) = ",Object.is('1',1));

// 细节：与 === 相比有两个地方不一样
console.log("+0 === -0",+0 === -0); // true
console.log("Object.is(+0,-0)",Object.is(+0,-0)); // false

console.log("NaN === NaN",NaN === NaN); // false
console.log("Object.is(NaN,NaN)",Object.is(NaN,NaN)); // true

// Object.fromEntries()


let obj1 = Object.fromEntries([
    ["name","Hydra"],
    ["age",35],
]);
console.log("obj1 = ",obj1);

let map = new Map([
    ["name","Hydra"],
    ["age",35],
]);
let obj2 = Object.fromEntries(map);
console.log("obj2 = ",obj2);